home *** CD-ROM | disk | FTP | other *** search
- /* This is a simple IIR filter. Change the magic numbers to taste. */
- #include <stdio.h>
-
- main() {
- float avg=0.5,y;
- int count=0,x;
- while (scanf("%d %g\n",&x,&y)!=EOF) {
- avg=0.9995*avg+0.0005*y;
- count++;
- if ((count%250)==1)
- printf("%d %g\n",count,avg);
- }
- }
-